﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="listmy.aspx.cs" Inherits="lcs.Web.project.listmy" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../js/CheckBox.js"></script>
    <link href="../jquery-ui.min.css" rel="stylesheet" />
<script src="../js/jquery-ui.min.js"></script>
      <script type="text/javascript">
         $(function () {
             $("#<%# txtKeyword.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
    <style type="text/css">
        .auto-style1 {
            width: 721px;
        }
         .blue td{ background-color:#04fad4;
        }
        .auto-style2 {
            width: 32px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td style="width: 80px" align="right" class="tdbg">
                         <b>项目名：</b>
                    </td>
                    <td class="tdbg">
                        <asp:TextBox ID="txtKeyword" runat="server" width="200px"></asp:TextBox> 
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />
            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="100%" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"  OnPageIndexChanging ="gridView_PageIndexChanging"
                     DataKeyNames="projectId" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="false" PageSize="15"  RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated">
                    <Columns>
                    		
		<asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:HyperLinkField HeaderText="管理" ControlStyle-Width="50" DataNavigateUrlFields="projectId" DataNavigateUrlFormatString="listout.aspx?id={0}"
                                Text="管理"  />
		<asp:BoundField DataField="proid" HeaderText="项目ID" SortExpression="proid" ItemStyle-HorizontalAlign="Center"  /> 
		<asp:BoundField DataField="user_name" HeaderText="工程管理" SortExpression="user_name" ItemStyle-HorizontalAlign="Center"  /> 
		<%--<asp:BoundField DataField="status" HeaderText="状态" SortExpression="status" ItemStyle-HorizontalAlign="Center"  />--%> 
		<asp:BoundField DataField="levelType" HeaderText="级别" SortExpression="levelType" ItemStyle-HorizontalAlign="Center"  /> 
		<asp:BoundField DataField="projectTypeName" HeaderText="项目类型" SortExpression="projectTypeName" ItemStyle-HorizontalAlign="Center"  />                       
                        
                    </Columns>
                </asp:GridView>
</asp:Content>
